package br.com.lopes.gci.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * PermissaoPerfil entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "permissao_perfil", catalog = "gcibd")
public class PermissaoPerfil implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3600586343326428908L;
	// Fields
	@Id
	@Column(name = "codigo", unique = true, nullable = false)
	private Integer codigo;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "codigo_perfil", nullable = false)
	private Perfil perfil;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "codigo_permissao", nullable = false)
	private Permissao permissao;

	// Constructors

	/** default constructor */
	public PermissaoPerfil() {
	}

	/** full constructor */
	public PermissaoPerfil(Integer codigo, Perfil perfil, Permissao permissao) {
		this.codigo = codigo;
		this.perfil = perfil;
		this.permissao = permissao;
	}

	// Property accessors
	
	public Integer getCodigo() {
		return this.codigo;
	}

	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}

	
	public Perfil getPerfil() {
		return this.perfil;
	}

	public void setPerfil(Perfil perfil) {
		this.perfil = perfil;
	}

	
	public Permissao getPermissao() {
		return this.permissao;
	}

	public void setPermissao(Permissao permissao) {
		this.permissao = permissao;
	}

}